home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Ebooks / Thinking in C++ V2 / C07 / Stash3.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-25  |  660 b   |  26 lines

  1. //: C07:Stash3.h
  2. // From Thinking in C++, 2nd Edition
  3. // Available at http://www.BruceEckel.com
  4. // (c) Bruce Eckel 1999
  5. // Copyright notice in Copyright.txt
  6. // Function overloading
  7. #ifndef STASH3_H
  8. #define STASH3_H
  9.  
  10. class Stash {
  11.   int size;      // Size of each space
  12.   int quantity;  // Number of storage spaces
  13.   int next;      // Next empty space
  14.   // Dynamically allocated array of bytes:
  15.   unsigned char* storage;
  16.   void inflate(int increase);
  17. public:
  18.   Stash(int size); // Zero quantity
  19.   Stash(int size, int initQuant);
  20.   ~Stash();
  21.   int add(void* element);
  22.   void* fetch(int index);
  23.   int count();
  24. };
  25. #endif // STASH3_H ///:~
  26.